package com.fy56.platform.logistics.service.impl.common;

import com.fy56.platform.logistics.model.Token;
import com.fy56.platform.logistics.redis.dao.ITokenDao;
import com.fy56.platform.logistics.service.common.ITokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by li on 2018-02-06 10:34
 */
@Service
public class TokenServiceImpl implements ITokenService {

    @Autowired
    protected ITokenDao tokenDao;

    @Override
    public Token createToken(long userId) {
        return tokenDao.createToken(userId);
    }

    @Override
    public Token getToken(String authentication) {
        return tokenDao.getToken(authentication);
    }

    @Override
    public boolean checkToken(Token model) {
        return tokenDao.checkToken(model);
    }

    @Override
    public void deleteToken(long userId) {
        tokenDao.deleteToken(userId);
    }
}
